"""
应用程序样式表
"""

STYLE_SHEET = """
/* 全局样式 */
QWidget {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 10pt;
}

/* 主窗口样式 */
QMainWindow {
    background-color: #f5f5f5;
}

/* 按钮样式 */
QPushButton {
    background-color: #2979ff;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    min-width: 80px;
}

QPushButton:hover {
    background-color: #448aff;
}

QPushButton:pressed {
    background-color: #1565c0;
}

QPushButton:disabled {
    background-color: #bdbdbd;
    color: #757575;
}

/* 新建连接按钮特殊样式 */
#new_connection_btn {
    background-color: #00c853;
    font-weight: bold;
    font-size: 12pt;
    padding: 12px 24px;
    min-height: 40px;
    min-width: 150px;
    margin: 10px 5px;
}

#new_connection_btn:hover {
    background-color: #00e676;
}

/* 表格样式 */
QTableWidget {
    border: 1px solid #e0e0e0;
    background-color: white;
    gridline-color: #f0f0f0;
}

QTableWidget::item {
    padding: 4px;
}

QTableWidget::item:selected {
    background-color: #e3f2fd;
    color: #1565c0;
}

QHeaderView::section {
    background-color: #f5f5f5;
    padding: 6px;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    font-weight: bold;
}

/* 树视图样式 */
QTreeWidget {
    border: 1px solid #e0e0e0;
    background-color: white;
}

QTreeWidget::item {
    height: 28px;
}

QTreeWidget::item:selected {
    background-color: #e3f2fd;
    color: #1565c0;
}

/* 标签页样式 */
QTabWidget::pane {
    border: 1px solid #e0e0e0;
    background-color: white;
}

QTabBar::tab {
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    padding: 8px 12px;
    margin-right: 2px;
}

QTabBar::tab:selected {
    background-color: white;
    border-bottom: 2px solid #2979ff;
}

QTabBar::tab:hover:!selected {
    background-color: #e0e0e0;
}

/* 分组框样式 */
QGroupBox {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-top: 16px;
    background-color: white;
}

QGroupBox::title {
    subcontrol-origin: margin;
    subcontrol-position: top left;
    left: 10px;
    padding: 0 5px;
    color: #424242;
    font-weight: bold;
}

/* 输入框样式 */
QLineEdit, QTextEdit {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 6px;
    background-color: white;
}

QLineEdit:focus, QTextEdit:focus {
    border: 1px solid #2979ff;
}

/* 下拉框样式 */
QComboBox {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 6px;
    background-color: white;
}

QComboBox::drop-down {
    subcontrol-origin: padding;
    subcontrol-position: center right;
    width: 20px;
    border-left: none;
}

/* 复选框样式 */
QCheckBox {
    spacing: 8px;
}

QCheckBox::indicator {
    width: 16px;
    height: 16px;
}

QCheckBox::indicator:unchecked {
    border: 1px solid #e0e0e0;
    background-color: white;
    border-radius: 2px;
}

QCheckBox::indicator:checked {
    border: 1px solid #2979ff;
    background-color: #2979ff;
    border-radius: 2px;
}

/* 滚动条样式 */
QScrollBar:vertical {
    border: none;
    background-color: #f5f5f5;
    width: 10px;
    margin: 0px;
}

QScrollBar::handle:vertical {
    background-color: #bdbdbd;
    min-height: 20px;
    border-radius: 5px;
}

QScrollBar::handle:vertical:hover {
    background-color: #9e9e9e;
}

QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical {
    height: 0px;
}

QScrollBar:horizontal {
    border: none;
    background-color: #f5f5f5;
    height: 10px;
    margin: 0px;
}

QScrollBar::handle:horizontal {
    background-color: #bdbdbd;
    min-width: 20px;
    border-radius: 5px;
}

QScrollBar::handle:horizontal:hover {
    background-color: #9e9e9e;
}

QScrollBar::add-line:horizontal, QScrollBar::sub-line:horizontal {
    width: 0px;
}

/* 分割器样式 */
QSplitter::handle {
    background-color: #e0e0e0;
}

QSplitter::handle:horizontal {
    width: 2px;
}

QSplitter::handle:vertical {
    height: 2px;
}

/* 菜单样式 */
QMenu {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

QMenu::item {
    padding: 6px 24px 6px 12px;
}

QMenu::item:selected {
    background-color: #e3f2fd;
    color: #1565c0;
}

/* 对话框按钮样式 */
QDialogButtonBox > QPushButton {
    min-width: 80px;
}

/* 特定按钮样式 */
QPushButton[text="删除"], QPushButton[text="删除连接"], QPushButton[text="删除集合"], QPushButton[text="删除文档"] {
    background-color: #f44336;
}

QPushButton[text="删除"]:hover, QPushButton[text="删除连接"]:hover, QPushButton[text="删除集合"]:hover, QPushButton[text="删除文档"]:hover {
    background-color: #ef5350;
}

QPushButton[text="编辑"], QPushButton[text="编辑连接"], QPushButton[text="编辑文档"] {
    background-color: #ff9800;
}

QPushButton[text="编辑"]:hover, QPushButton[text="编辑连接"]:hover, QPushButton[text="编辑文档"]:hover {
    background-color: #ffa726;
}

QPushButton[text="添加文档"], QPushButton[text="创建集合"], QPushButton[text="添加键值对"] {
    background-color: #4caf50;
}

QPushButton[text="添加文档"]:hover, QPushButton[text="创建集合"]:hover, QPushButton[text="添加键值对"]:hover {
    background-color: #66bb6a;
}

QPushButton[text="查询"] {
    background-color: #9c27b0;
}

QPushButton[text="查询"]:hover {
    background-color: #ab47bc;
}

QPushButton[text="刷新"] {
    background-color: #00bcd4;
}

QPushButton[text="刷新"]:hover {
    background-color: #26c6da;
}
"""
